package com.ets.common;

import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/*------------------------------------------------------------------------------
 System-wide <big><b>DateUtils</b></big> class
 <br><br>
 @author D.Merkling - 1:33:38 PM - Aug 22, 2011
 <br><br>
 @version 1.0  
------------------------------------------------------------------------------*/
public abstract class DateUtils
  {
   public static Timestamp getTmstmp ()
	 {
	  GregorianCalendar now = new GregorianCalendar();
	  Date today            = now.getTime(); 
	  long nanos            = today.getTime();
	  Timestamp ts          = new Timestamp(nanos);
      return ts;
	 }

   public static String strDt (Date dt)
     {
	  String tmpDt = dt.toString();
      return tmpDt;
     }

   /*------------------------------------------------------------------------------
	Returns today's date
	<br><br>
	@return Date - A <b><i>Date</i></b> variable
   ------------------------------------------------------------------------------*/
   public static Date getToday()
     {
      GregorianCalendar dflt = new GregorianCalendar();
      dflt.set(Calendar.HOUR_OF_DAY, 0);
      dflt.set(Calendar.MINUTE,      0);
      dflt.set(Calendar.SECOND,      0);
      Date dt = (Date) dflt.getTime();
	  return dt;
     }
  }
